" VimL虚拟机 Phase 0 演示程序
" 展示所有已实现的核心功能

echo "=== VimL虚拟机 Phase 0 演示 ==="

" 1. 基本数据类型和变量
echo "1. 基本数据类型:"
let num = 42
let str = "Hello VimL"
let bool = 1
echo num
echo str
echo bool

" 2. 算术运算
echo "2. 算术运算:"
let a = 10
let b = 5
let sum = a + b
let diff = a - b
let prod = a * b
let quot = a / b
echo sum
echo diff
echo prod
echo quot

" 3. 条件语句
echo "3. 条件语句:"
let x = 15
if x > 10
    echo "x大于10"
elseif x == 10
    echo "x等于10"
else
    echo "x小于10"
endif

" 4. while循环
echo "4. while循环:"
let counter = 0
while counter < 3
    echo counter
    let counter = counter + 1
endwhile

" 5. for循环（Phase 0重点功能）
echo "5. for循环:"
let items = 5
let item = 0
for item in items
    echo item
endfor

" 6. 嵌套循环
echo "6. 嵌套循环:"
let outer = 2
let inner = 3
let i = 0
let j = 0
for i in outer
    for j in inner
        echo i
        echo j
    endfor
endfor

echo "=== 演示完成 ==="
echo 999